import { createApp } from "vue";
import { createPinia } from "pinia";

import App from "./App.vue";
import router from "@/router/index";
import lazy from "@/directs/lazy";
import clickOutside from "@/directs/click-outside";
import "element-plus/dist/index.css";
import * as ElementPlusIconsVue from "@element-plus/icons-vue";
// // 引入注册脚本, 本地SVG图标
// import "virtual:svg-icons-register";

const app = createApp(App);

// 屏蔽错误信息
app.config.errorHandler = () => null;
// 屏蔽警告信息
app.config.warnHandler = () => null;

for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component);
}
app.use(lazy);
app.use(clickOutside);
app.use(createPinia());
app.use(router);
// 设置console.log函数为空函数，使其不输出任何信息
// console.log = function () {};

app.mount("#app");
